<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Event事件</title>
</head>
<body>
<input onblur="lostFocus()"  onfocus="getFocus()"  type="text">
<script>
    //定义获取焦点事件
    function getFocus(){
        document.getElementsByTagName("input")[0].style.outlineColor="red"
        document.getElementsByTagName("input")[0].style.height="100px";
        document.getElementsByTagName("input")[0].style.weight="100px";
    }
    //定义失去焦点事件,大小不写  回不来
    function  lostFocus(){
        document.getElementsByTagName("input")[0].style.border="2px  inset"
        document.getElementsByTagName("input")[0].style.height="18.91px";
        document.getElementsByTagName("input")[0].style.weight="169.82px";
    }
</script>
</body>
</html>